import request from './request.js';
let service = request.service;
let formatterUrl = request.formatterUrl;
export default {
  insertUpdatePlanTask1(type, data) {
    /**insert-新增计划任务 update-编辑计划任务**/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/${type}`,
      method: 'post',
      data
    })
  },
  updateMpWx(data) {
    /**insert-新增计划任务 update-编辑计划任务**/
    return service({
      url: `/adscm/operation/plan/wxMp/updateMpWx`,
      method: 'post',
      data
    })
  },
  insertMpWx(data) {
    /**insert-新增外协任务**/
    return service({
      url: `/adscm/operation/plan/wxMp/insertMpWx`,
      method: 'post',
      data
    })
  },
  planTaskList1(data) {
    /**计划任务列表**/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/select`,
      method: 'post',
      data
    })
  },
  selectMpWxByCondition(data) {
    /**外协任务列表**/
    return service({
      url: `/adscm/operation/plan/wxMp/selectMpWxByCondition`,
      method: 'post',
      data
    })
  }, 
  planTaskListFor29Input(data) {
    /**计划任务列表**/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/uploadSignExcel`,
      method: 'post',
      data
    })
  },
  planTaskDetailList1(tid) {
    /**计划任务详情列表**/
    return service({
      url: `/adscm/operation/plan/planTask/selectByTid/${tid}`,
      method: 'post'
    })
  },
  insertUpdatePlanTask(type, data) {
     /**insert-新增计划任务 update-编辑计划任务**/
     return service({
       url: `/adscm/operation/plan/planTask/${type}`,
       method: 'post',
       data
     })
  },
  planTaskList(data){
    /**计划任务列表**/
    return service({
      url: `/adscm/operation/plan/planTask/select`,
      method: 'post',
      data
    })
  },
  planTaskSelectDetailDList(resultId){
    /**查看详情**/
    return service({
      url: `/adscm/operation/base/planTaskView/selectDetail/${resultId}`,
      method: 'post',
    })
  },
  planTaskDetailList(tid,totalId) {
     /**工序加工面列表**/
     return service({
       url: `/adscm/operation/plan/planTaskDetail/selectByTid/${tid}/${totalId}`,
       method: 'post'
     })
  },
  /**29所 完成资料上传*/ 
  finishDrawUpload(id) {
    return service({
      url: `/adscm/operation/plan/planTaskTotal/finishDrawUpload/${id}`,
      method: 'post'
    })
  },
  planTaskGanTList(data) {
     /**计划任务甘特表查询**/
     return service({
       url: `adscm/operation/plan/planTask/selectByConditon`,
       method: 'post',
       data
     })
  },

  insertUpdatePlanTaskDetail(type, data) {
      /**insert-新增工序加工面 update-编辑工序加工面**/
      return service({
        url: `/adscm/operation/plan/planTaskDetail/${type}`,
        method: 'post',
        data
      })
  },
  planTaskCutterList(tid) {
    /**获取刀具列表**/
    return service({
      url: `/adscm/operation/plan/planTaskCutter/selectByTid/${tid}`,
      method: 'post'
    })
  },
  insertUpdatePlanTaskCutter(type, data) {
    /**insert-新增刀 update-编辑刀**/
    return service({
      url: `/adscm/operation/plan/planTaskCutter/${type}`,
      method: 'post',
      data
    })
  },
  
  insertPlanTaskGanttMapData(data){
    /**insert-保存排程甘特图数据 **/
    return service({
      url: `/adscm/operation/plan/planResult/insertPlanResult`,
      method: 'post',
      data
    })
  },
  saveInsertOrderData(data){
    /**insert-保存插单数据 **/
    return service({
      url: `/adscm/operation/plan/planResult/insertInterspersed`,
      // url: `/adscm/operation/plan/planResult/insertInterspersed`,
      method: 'post',
      data
    })
  },
  saveChartsData(data){
    /**insert-保存插单数据 **/
    return service({
      url: `/adscm/operation/plan/planTaskDetail/updateByCharts`,
      // url: `/adscm/operation/plan/planResult/insertInterspersed`,
      method: 'post',
      data
    })
  },
  planTaskGanTTList(date,shift) {
    /**计划任务甘特表查询**/
    return service({
      url: `/adscm/operation/plan/planResult/selectResultByDate/${date}/${shift}`,
      method: 'post',
    })
  },
  planTaskGanTTTime(data) {
    /**根据设备编号+日期查询当前设备的排程时间相关信息**/
    return service({
      url: `adscm/operation/plan/planResult/selectResultByMacDate`,
      method: 'get',
      params:data
    })
  },
  planTaskOperatorTTList(date) {
    /**计划任务甘特表操作人员**/
    return service({
      url: `/adscm/operation/plan/planResult/getProductOperator`,
      method: 'post',
    })
  },
  getDeptAllUsersByCode(deptCode) {
    /**编组人员信息
     * 
     *  数铣组 SX_GROUP
        普洗组 PX_GROUP
        车工组 PC_GROUP
        钳工组 QG_GROUP
        检验组 JY_GROUP
     * 
     * **/
    return service({
      url: `/adscm/system/user/getDeptAllUsersByCode/${deptCode}`,
      method: 'post',
    })
  },
  checkQs(checkId) {
    /**检验签收 */
    return service({
      url: `/adscm/operation/plan/planTaskProcessCheck/checkQs/${checkId}`,
      method: 'post',
    })
  },
  selectCpk(data) {
    /**查询成品库库存记录 */
    return service({
      url: `/adscm/operation/plan/planTaskTotal/selectCpk`,
      method: 'post',
      data
    })
  },
  selectUnqualByCondition(data) {
    /**条件查询不合格品记录 */
    return service({
      url: `/adscm/operation/plan/unqualifiedProduct/selectUnqualByCondition`,
      method: 'post',
      data
    })
  }, 
  editUnqualified(data) {
    /**处理信息 */
    return service({
      url: `/adscm/operation/plan/unqualifiedProduct/editUnqualified`,
      method: 'post',
      data
    })
  },

  saveOperatorData(planResultId,type,operator,remark){
    /**insert-保存操作人员 **/
    return service({
      url: `/adscm/operation/plan/planResult/saveProductOperator/${planResultId}/${type}/${operator}/${remark}`,
      // url: `/adscm/operation/plan/planResult/insertInterspersed`,
      method: 'post',
    })
  },
  saveOperatorListData(type,data){
    /**insert-批量保存操作人员   //type = 1：计划操作者，2：实际操作者 3.计划钳工  4.实际钳工 5.计划质检 6.实际质检 **/
    return service({
      url: `/adscm/operation/plan/planResult/saveProductOperatorList/${type}`,
      // url: `/adscm/operation/plan/planResult/insertInterspersed`,
      method: 'post',
      data
    })
  },
  planTaskMacList(){
    /**获取设备号**/
    return service({
      url: `/adscm/operation/plan/planResult/getProductMac`,
      method: 'post',
    })
  },
  planTaskSearchGanttList(data){
    /**甘特图条件查询---数铣**/
    return service({
      url: `/adscm/operation/plan/planResult/selectResultByCondition`,
      method: 'post',
      data
    })
  },
  planTaskSetOperatorGanttList(data){
    /**批量派工--数铣**/
    return service({
      url: `/adscm/operation/plan/planResult/setOperator`,
      method: 'post',
      data
    })
  },
  planTaskSearchWorkerLoadList(data){
    /**甘特图条件查询负荷---数铣**/
    return service({
      url: `/adscm/operation/plan/planResult/selectMacWorkerLoad`,
      method: 'post',
      data
    })
  },
  planTaskSelectViews(){
    /**查询待办任务**/
    return service({
      url: `/adscm/operation/base/planTaskView/selectViews`,
      method: 'post',
    })
  },
  async planTaskNumsByMergeCode(mergeCode){
    /**通过并单号查询数量**/
    return service({
      url: `/adscm/operation/base/planTaskView/selectNumsByMergeCode/${mergeCode}`,
      method: 'post',
    })
  },
  planTaskDetailByMergeCode(mergeCode){
    /**通过并单号查询加工面信息**/
    return service({
      url: `/adscm/operation/base/planTaskView/selectByMergeCode/${mergeCode}`,
      method: 'post',
    })
  },
  planTaskSaveRepeat(data){
    /**保存并单**/
    return service({
      url: `/adscm/operation/base/planTaskView/mergeView`,
      method: 'post',
      data
    })
  },
  planTaskSaveSplitRepeat(viewId,data){
    /**保存并单**/
    return service({
      url: `/adscm/operation/base/planTaskView/splitView/${viewId}`,
      method: 'post',
      params:data
    })
  },
  insertOrderDataByConditionList(data){
    /**保存插单甘特图操作（bottom）---数铣**/
    return service({
      url: `/adscm/operation/plan/planResult/updatePlan`,
      method: 'get',
      params:data
    })
  },
  planTaskGraphLineDataByDate(date){
    /**通过日期查询排程分析折线图的数据**/
    return service({
      url: `/adscm/operation/base/taskAnalysis/gxPriceAnalysis/${date}`,
      method: 'post',
    })
  },
  planTaskGraphProcess(){
    /**获取排程分析的工序类型集合数据**/
    return service({
      url: `/adscm/operation/base/taskAnalysis/gxAllProcedure`,
      method: 'post',
    })
  },
  planTaskGraphPieDataByDate(year,month){
    /**通过日期年、月查询排程分析饼图的数据**/
    return service({
      url: `/adscm/operation/base/taskAnalysis/gxAllPriceAnalysisMonth/${year}/${month}`,
      method: 'post',
    })
  },
  orderGraphTopBarByCondtion(data){
    /**通过日期年、月查询订单数据 /adscm/operation/plan/planTaskTotalStatistics/selectBelongYearMonthAllTaskNo**/
    return service({
      url: `/adscm/operation/plan/planTaskTotalStatistics/selectTaskNoWbPlanFinishDateNums`,
      method: 'post',
      data,
    })
  },
  orderGraphTopBarByDate(data){
    /**通过日期年、月查询订单数据 **/
    return service({
      url: `/adscm/operation/plan/planTaskTotalStatistics/selectBelongYearMonthAllTaskNo`,
      method: 'post',
      data,
    })
  }, 
  queryTopDetailTableListData(data){
    /**通过日期年、月查*/
    return service({
      url: `/adscm/operation/plan/planTaskTotalStatistics/selectWbPlanFinishDateDrawDetailNums`,
      method: 'post',
      data,
    })
  },
  orderGraphBottomBarByCondtion(data){
    /**通过日期年、月查询工序数据*/
    return service({
      url: `/adscm/operation/plan/planTaskTotalStatistics/selectGxStatisticsByTaskNo`,
      method: 'post',
      data,
    })
  }, 
  queryBottomDetailTableListData(data){
    /**查询某个工序的图纸详细列表*/
    return service({
      url: `/adscm/operation/plan/planTaskTotalStatistics/selectDrawListByGx`,
      method: 'post',
      data,
    })
  },
  queryTopDetailGxData(data){
    /**获取一天相关数据的工序数据*/
    return service({
      url: `/adscm/operation/plan/planTaskTotalStatistics/selectGxStatisticsByDay`,
      method: 'post',
      data,
    })
  },
  selectUsersDzjzByDate(data){
    /**查询员工工作内容缔造价值*/
    return service({
      url: `/adscm/operation/plan/dzjz/selectUsersDzjzByDate`,
      method: 'post',
      data,
    })
  }, 
  getGzAndLjInfo(tid){
    /**获取工装与量具信息*/
    return service({
      url: `adscm/operation/plan/planTaskProcess/selectProcessProduction/${tid}`,
      method: 'get',
    })
  }, 
  insertDzjz(data){
    /**进行员工日常工作任务节点工时统筹数据上传*/
    return service({
      url: `/adscm/operation/plan/dzjz/insertDzjz`,
      method: 'post',
      data,
    })
  },
  insertCutterAndLinkCurrentFace(data){
    /**新增刀具库里面不存在的刀具*/
    return service({
      url: `adscm/operation/plan/planTaskDetail/insertCutterAndLinkCurrentFace`,
      method: 'post',
      data,
    })
  },
  insertDj(data){
    /**进行员工日常工作任务节点工时统筹数据上传*/
    return service({
      url: `adscm/operation/plan/planTaskDetail/chooseCutter`,
      method: 'post',
      data,
    })
  },
  updateOrderPlanStatus(ptaskNo,orderPlanStatus,year){
    /**修改某一个结账订单/子订单的生产计划状态*/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/updateOrderPlanStatus/${ptaskNo}/${orderPlanStatus}/${year}`,
      method: 'post',
    })
  }, 
  updateTaskPlanStatus(ptaskNo,orderPlanStatus){
    /**修改某一个图纸任务的生产计划状态*/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/updateTaskPlanStatus/${ptaskNo}/${orderPlanStatus}`,
      method: 'post',
    })
  },
  queryDetailData(year,month){
    /**获取一天相关数据的工序数据*/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/selectBelongYearMonthDrawInfo/${year}/${month}`,
      method: 'post',
    })
  },
  selectDzjzGantt(userId,startDate,endDate){
    /**查询某个用户某个时间段的缔造价值统计甘特图：*/
    return service({
      url: `/adscm/operation/plan/dzjz/selectDzjzGantt/${userId}/${startDate}/${endDate}`,
      method: 'post',
    })
  },
  selectOrderTotalStatistics(year){
    /**查询某一年的结账订单的综合统计数据（包含这个结账订单的所有工序统计数据）：*/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/selectOrderTotalStatistics/${year}`,
      method: 'post',
    })
  },
  selectOrderChildrenStatistics(ptaskNo,year){
    /**查询某一个结账订单下的子订单综合统计数据：*/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/selectOrderChildrenStatistics/${ptaskNo}/${year}`,
      method: 'post',
    })
  },
  queryDrawDetailTableListData(ptaskNo,year){
    /**查询某一个结账订单下的子订单综合统计数据：*/
    return service({
      url: `/adscm/operation/plan/planTaskTotal/nv/selectOrderChildrenTaskList/${ptaskNo}/${year}`,
      method: 'post',
    })
  },
  getAllUserInfo(){
    /**查询某一个结账订单下的子订单综合统计数据：*/
    return service({
      url: `/adscm/operation/plan/dzjz/selectUserList`,
      method: 'post',
    })
  },
  selectUsersAllDzjzForDate(userId,startDate,endDate){
    /**查询某一个结账订单下的子订单综合统计数据：*/
    return service({
      url: `/adscm/operation/plan/dzjz/selectUsersAllDzjz/${userId}/${startDate}/${endDate}`,
      method: 'post',
    })
  }, 
  queryByCondition(data){
    /**获取一天相关数据的工序数据*/
    return service({
      url: `/adscm/operation/production/queryByCondition`,
      method: 'post',
      data,
    })
  }, 
  queryStorageByCondition(data){
    /**条件查询出入库记录*/
    return service({
      url: `/adscm/operation/storage/queryByCondition`,
      method: 'post',
      data,
    })
  },
  productionGroupNodeAll(){
    return service({
      url: 'adscm/operation/plan/productionGroup/getAllProductionGroup',
      /**获取产具节点 */
      method: 'get'
    })
  }, 

  getWorkerList(){
    return service({
      url: '/adscm/operation/plan/dzjz/selectUserList',
      /**获取工作人员清单*/
      method: 'get'
    })
  },  
  queryMachineList(){
    return service({
      url: '/adscm/operation/base/machine/selectMachineOnUse',
      /**查询机器列表*/
      method: 'get'
    })
  },  
  queryPRODUCTION_ACCESS_STORAGE(type){
    return service({
      url: `/adscm/system/code/queryCoedByType/${type}`,
      /**查询单一资源的出入库类型*/
      method: 'get'
    })
  },
  addUpdateProductionGroup(type, data) {
    /**addProductionGroup-新增产具 editProductionGroup-编辑产具**/
    return service({
      url: `adscm/operation/plan/productionGroup/${type}`,
      method: 'post',
      data
    })
  },
  deleteProductionGroup(id) {
    /**删除菜单 */
    return service({
      url: `adscm/operation/plan/productionGroup/delProductionGroup/${id}`,
      method: 'post',
    })
  },
  deleteRow(data) {
    /**删除刀具 */
    return service({
      url: `/adscm/operation/plan/planTaskDetail/removeCutter`,
      method: 'post',
      data,
    })
  },
  insertProduction(data) {
    /**insertProduction**/
    return service({
      url: `/adscm/operation/production/insertProduction`,
      method: 'post',
      data
    })
  },
  insertStorage(data) {
    /**insertStorage**/
    return service({
      url: `/adscm/operation/storage/insertStorage`,
      method: 'post',
      data
    })
  },
  editProduction(data) {
    /**editProduction**/
    return service({
      url: `/adscm/operation/production/editProduction`,
      method: 'post',
      data
    })
  },
  delProduction(id) {
    /**删除菜单 */
    return service({
      url: `/adscm/operation/production/delProduction/${id}`,
      method: 'post',
    })
  },

  queryProReadyByCondition(data){
    return service({
      url: `/adscm/operation/plan/productReady/queryProReadyByCondition`,
      /**查询生产准备清单列表*/
      method: 'post',
      data
    })
  },
  addDept(data) {
    /**addDept 新增部门数据**/
    return service({
      url: `/adscm/system/dept/addDept`,
      method: 'post',
      data
    })
  },
  getAllDept(){
    /**getAllDept 查询部门数据**/
    return service({
      url: `/adscm/system/dept/getAllDept`,
      method: 'post',
    })
  },
  getDeptAllUsers(deptId){
    /**getDeptAllUsers 查询班组人员**/
    return service({
      url: `/adscm/system/user/getDeptAllUsers/${deptId}`,
      method: 'post',
    })
  },
  setDeptUsers(deptId,data){
    /**setDeptUsers 设置班组员工**/
    return service({
      url: `/adscm/system/user/setDeptUsers/${deptId}`,
      method: 'post',
      params:data,
    })
  },
  setDeptUsersRoles(deptId,data){
    /**setDeptUsers 设置班组员工**/
    return service({
      url: `/adscm/system/user/setDeptUsersRoles/${deptId}`,
      method: 'post',
      params:data,
    })
  },
  delDeptUsers(deptId,userId){
    /**delDeptUser 删除班组员工**/
    return service({
      url: `/adscm/system/user/delDeptUser/${deptId}/${userId}`,
      method: 'post',
    })
  },  
  updateReadyStatus(data){
    return service({
      url: `/adscm/operation/plan/productReady/updateReadyStatus`,
      /**更新生产准备状态*/
      method: 'post',
      data
    })
  },
  insertCheck(data){
    return service({
      url: `/adscm/operation/plan/planTaskProcessCheck/insertCheck`,
      /**新增工序生产检验 记录*/
      method: 'post',
      data
    })
  },
  queryProReadyDetail(id){
    return service({
      url: `/adscm/operation/plan/productReady/queryProReadyDetail/${id}`,
      /**查询生产准备详情*/
      method: 'post',
    })
  },
  updateRwxf(processDetailId,data){
    return service({
      url: `/adscm/operation/plan/productManage/rwxf/${processDetailId}`,
      method: 'get',
      params:data,
    })
  },
  updateRwqs(processDetailId){
    return service({
      url: `/adscm/operation/plan/productManage/rwqs/${processDetailId}`,
      method: 'post',
    })
  },
  updateRwkg(processDetailId){
    return service({
      url: `/adscm/operation/plan/productManage/rwkg/${processDetailId}`,
      method: 'post',
    })
  },
  updateRwwg(processDetailId){
    return service({
      url: `/adscm/operation/plan/productManage/rwwg/${processDetailId}`,
      method: 'post',
    })
  },
  selectProcessDetailGc(processDetailId){
    return service({
      url: `/adscm/operation/plan/productManage/selectProcessDetailGc/${processDetailId}`,
      method: 'post',
    })
  },
  sxZj(code){
    return service({
      url: `/adscm/operation/plan/productManage/sxZj/${code}`,
      method: 'post',
    })
  },
  pxGzgc(code){
    return service({
      url: `/adscm/operation/plan/productManage/pxGzgc/${code}`,
      method: 'post',
    })
  },
  selectCurrentUserPdMsg(currentPage,pageSize){
    return service({
      url: `/adscm/operation/plan/productManage/selectCurrentUserPdMsg/${currentPage}/${pageSize}`,
      method: 'post',
    })
  },
  rwqsAndKg(processDetailId){
    return service({
      url: `/adscm/operation/plan/productManage/rwqsAndKg/${processDetailId}`,
      method: 'post',
    })
  },
  selectCurrentUserSxMsg(data){
    return service({
      url: `/adscm/operation/plan/productManage/selectCurrentUserSxMsg`,
      method: 'post',
      data,
    })
  },
  cpkOut(data){
    return service({
      url: `/adscm/operation/plan/planTaskTotal/cpkOut`,
      method: 'get',
      params:data,
    })
  },
  cpkOutSingle(totalId,num){
    return service({
      url: `/adscm/operation/plan/planTaskTotal/cpkOutSingle/${totalId}/${num}`,
      method: 'post',
    })
  },
  selectOut(data){
    return service({
      url: `/adscm/operation/plan/planTaskTotal/selectOut`,
      method: 'post',
      data,
    })
  },
  selectCurrentUserPxMsg(data){
    return service({
      url: `/adscm/operation/plan/productManage/selectCurrentUserPxMsg`,
      method: 'post',
      data,
    })
  },
  queryNeedBuyByCondition(data){
    return service({
      url: `/adscm/operation/production/queryByState`,
      method: 'post',
      data,
    })
  },
  editProductionNeedBuyByCondition(data){
    return service({
      url: `/adscm/operation/production/editProduction`,
      method: 'post',
      data,
    })
  },
  selectSxzjList(processDetailId){
    /**查询某个任务的装夹列表*/
    return service({
      url: `/adscm/operation/plan/productManage/selectSxzjList/${processDetailId}`,
      method: 'post',
    })
  },
  selectCheck(data){
    /**分页条件查询检验记录 */
    return service({
      url: `/adscm/operation/plan/planTaskProcessCheck/selectCheck`,
      method: 'post',
      data,
    })
  },
  updateCheck(data){
    /**修改检验记录（检验人员回填检验内容） */
    return service({
      url: `/adscm/operation/plan/planTaskProcessCheck/updateCheck`,
      method: 'post',
      data,
    })
  }, 
  choosePc(data){
    return service({
      url: `/adscm/operation/plan/productManage/choosePc`,
      method: 'get',
      params:data,
    })
  }, 
}